<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
/*
*
* Copyright (c) 2011 Vaulting Systems International
* 
* Permission is hereby granted, free of charge, to any person obtaining a copy 
* of this software and associated documentation files (the "Software"), to deal 
* in the Software without restriction, including without limitation the rights 
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
* of the Software, and to permit persons to whom the Software is furnished to do  
* so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all  
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE  
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title><s:text name="vendor.registration.title" /></title>
	<sj:head jquerytheme="smoothness" jqueryui="true" />
	
	    <script type="text/javascript">    
    
	    $.subscribe('beforeRegisterVendor', function(event,data) {       
				//alert('Before AJAX');           
		    }
	    );     

	    $.subscribe('completeRegisterVendor', function(event,data) {          
				//alert('Complete AJAX');
				$('#submitRegistration', this).attr('disabled', 'true');
				$('#divComplete').show();
			}
	    );     

	    $.subscribe('errorState', function(event,data) {         
	        	alert('errorState status: ' + event.originalEvent.status + '\n\nrequest status: ' +event.originalEvent.request.status); 
			}
	    );     
	</script>        	
	
<style>
a.normalLink:link { color: #0000FF; font-size:14px;
	font-weight:bold; text-decoration: underline }
a.normalLink:visited { color: #0000FF; font-size:14px;
	font-weight:bold; text-decoration: underline }
a.normalLink:hover { color: #FF0000; font-size:14px;
	font-weight:bold; text-decoration: underline }
</style>	
</head>
<body bgColor="#ffffff" leftMargin="0" topMargin="0" rightMargin="0">

<table border="0" cellspacing="0" cellpadding="0" width="850px" height="75px" align="center" >
<tr><td>
        <div id="headline">
	        <h1 class="ui-state-default" style="background: none; border: none;"><s:text name="headline.title" /></h1>
	        <h4 class="ui-state-default" style="background: none; border: none;"><s:text name="headline.version" /></h4>        
        </div>

</td></tr>
</table>

<table border="0" cellspacing="0" cellpadding="0" width="850px" align="center" >
<tr><td>
<div id="divNewVendor" >
	<h3 class="ui-state-default" ><s:text name="vendor.registration.title" /></h3>

	<s:form id="registrationForm" name="registrationForm" action="registerVendor.action" method="post" validate="true">
	
    <s:textfield name="vendorProfile.name" value="%{vendorProfile.name}" 
    	cssClass="ui-state-default" cssStyle="background: none;"
    	label="%{getText('vendor.profile.name')}" size="40" required="true" />
    	
    <s:textfield name="vendorProfile.address" value="%{vendorProfile.address}"
    	cssClass="ui-state-default" cssStyle="background: none;"
    	label="%{getText('vendor.profile.address')}" size="40"/>
    	
    <s:textfield name="vendorProfile.city" value="%{vendorProfile.city}" 
    	cssClass="ui-state-default" cssStyle="background: none;"
    	label="%{getText('vendor.profile.city')}" size="40"/>
    	
    <s:textfield name="vendorProfile.state" value="%{vendorProfile.state}" 
    	cssClass="ui-state-default" cssStyle="background: none;"
    	label="%{getText('vendor.profile.state')}" size="40" maxlength="2" />    	
    	
    <s:textfield name="vendorProfile.zip" value="%{vendorProfile.zip}" 
    	cssClass="ui-state-default" cssStyle="background: none;"
    	label="%{getText('vendor.profile.zip')}" size="40"/>    	
    	
    <s:textfield name="vendorProfile.phone" value="%{vendorProfile.phone}" 
    	cssClass="ui-state-default" cssStyle="background: none;"
    	label="%{getText('vendor.profile.phone')}" size="40"/>    	

    <s:textfield name="vendorProfile.emailAddress" value="%{vendorProfile.emailAddress}"
    	cssClass="ui-state-default" cssStyle="background: none;"
    	label="%{getText('vendor.profile.emailAddress')}" size="40" required="true" />    	

	<sj:submit 
			name="submitRegistration"
			id="submitRegistration"
			targets="divResult" 
			effect="highlight" 
			value="Submit" 
			onBeforeTopics="beforeRegisterVendor"                                          
			onCompleteTopics="completeRegisterVendor"                                          
			onErrorTopics="errorState"   
			button="true"
		/>

    	
	</s:form>
	<br /><s:text name="required.fields.label" />
	
</div>
<br /><br />
<div id="divResult" class="ui-state-default" style="background: none; border: none;"></div>
<br /><br />
<div id="divComplete" class="ui-state-default" style="background: none; border: none;display:none;"><s:text name="register.logout.1" />&nbsp;<a class="normalLink" href='<s:url value="/j_spring_security_logout"/>'><s:text name="click.here" /></a>&nbsp;<s:text name="register.logout.2" /></div>
</td></tr>
</table>

<table border="0" cellspacing="0" cellpadding="0" width="850px" align="center" >
<tr><td>
<p align="center" class="ui-state-default"><s:text name="footer.copy" /></p>
</td></tr>
</table>

</body>

</html>